#include <stdio.h>
#include "typedef.h"
#include "bitmap.h"
#include "convert.h"
#include "bilateral.h"

int main() {

  Bitmap src, gray, bil;
  FILE *fpw;
  int t;

  CheckPath("./test.bmp");
  ReadBitmap("./test.bmp", &src);

  RGBToGray(&src, &gray);


  fpw = fopen("gray.bmp", "wb");
  SaveBitmap("gray.bmp", &gray);
  fclose(fpw);

  fpw = fopen("bil.bmp", "wb");
  Bilateral(&gray, &bil, 10, 10);
  SaveBitmap("bil.bmp", &bil);
  fclose(fpw);

  return 0;

}